fix: set redirected property on redirect responses#746
Conversation
redirected property on redirect responses
| */ | ||
|
|
||
| requestInit.headers = request.headers | ||
| return fetch(new Request(locationUrl, requestInit)) |
There was a problem hiding this comment.
Interesting that fetch doesn't set that property based on the location header. I suppose the reason is because it's the end response that's marked as redirected?
@erikshestopal did you by any chance have a reference to the spec that describes .redirected?
There was a problem hiding this comment.
I was going off the undici implementation which sets the url list but for mockiing I opted for a simpler approach.
https://github.com/search?q=repo%3Anodejs%2Fundici+redirected&type=code
kettanaito
left a comment
There was a problem hiding this comment.
Thanks for fixing this, @erikshestopal!
Released: v0.39.7 🎉This has been released in v0.39.7! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Description
Sets the
.redirectedproperty on redirected requests to comply with theFetchspec.Failing scenario using
msw: